<h1>Imagini oferta</h1>

<form action="<?php echo url_for('offer/images?offer_id='.$offer->getId()) ?>" method="post" enctype="multipart/form-data">
  <table>
    <tfoot>
      <tr>
        <td colspan="2">
          <?php echo $form->renderHiddenFields(false) ?>
          <input type="submit" name="next" value="Save" />
          <input type="submit" name="next" value="Save and add Locations" />
          <input type="submit" name="next" value="Save and go to Offer" />
          <br />
          &nbsp;<a href="<?php echo url_for('offer/index') ?>">Back to list</a>
          &nbsp;<a href="<?php echo url_for('offer/edit?id='.$offer->getId()) ?>">Offer</a>
          &nbsp;<a href="<?php echo url_for('offer/locations?offer_id='.$offer->getId()) ?>">Locations</a>
        </td>
      </tr>
    </tfoot>
    <tbody>
      <?php echo $form->renderGlobalErrors() ?>
       <tr>
        <th><?php echo $form['image']->renderLabel() ?></th>
        <td>
          <?php echo $form['image']->renderError() ?>
          <?php echo $form['image'] ?>
        </td>
      </tr>
       <tr>
        <th><?php echo $form['url']->renderLabel() ?></th>
        <td>
          <?php echo $form['url']->renderError() ?>
          <?php echo $form['url'] ?>
        </td>
      </tr>
    </tbody>
  </table>
</form>

<?php foreach($offer_images as $offer_image): ?>
  <img src="/uploads/offers/small/<?php echo $offer_image->getImage() ?>" />
  <a href="<?php echo url_for('offer/deleteImage?id='.$offer_image->getId()) ?>">Sterge</a>
<?php endforeach; ?>

